package com.yh.util;

import com.yh.javabean.Student;
import dao.StudentDao;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.ArrayList;

public class StudentDaoTest {
    public static void main(String[] args) {
        SqlSessionFactory factory = MyBatisUtil.getSqlSessionFactory();
        SqlSession session = factory.openSession(true);
        StudentDao dao = session.getMapper(StudentDao.class);
        ArrayList<Student> students = dao.selectAll();
        for (Student student : students) {
            System.out.println(student);
        }
        session.close();
    }
}
